package com.atguigu.dto;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor

public class Result {
    private Integer code;
    private String message;
    private Object data;
    public static Result success() {
        Result result = new Result();
        result.code = 200;
        result.message = "success";
        result.data = null;
        return result;

    }
    public static Result success(Object data) {
        Result result = new Result();
        result.code = 200;
        result.message = "success";
        result.data = data;
        return result;
    }
    public static Result error() {
        Result result = new Result();
        result.code = 500;
        result.message = "error";
        result.data = null;
        return result;
    }
}
